<?php
/** @var OportunidadController $this */
/** @var Oportunidad $model */
/** @var AweActiveForm $form */
// Prevenir que jquery se cargue dos veces
Yii::app()->clientScript->scriptMap['jquery.js'] = false;
//Util::tsRegisterAssetJs('_form.js');
//
Util::tsRegisterAssetJs('_form_modal.js');
/** @var CampaniaController $this */
$form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
    'id' => 'campania-form',
    'type' => 'horizontal',
//    'action' =>Yii::app()->createUrl('/campanias/campania/update', array('id' => $model->id)),
//    'action' => $model->isNewRecord ? Yii::app()->createUrl('/campanias/campania/create') : Yii::app()->createUrl('/campanias/campania/update', array('id' => $model->id)),
    'enableAjaxValidation' => true,
    'clientOptions' => array('validateOnSubmit' => false, 'validateOnChange' => false,),
    'enableClientValidation' => false,
        ));
?>
<div class="modal-header">
    <a class="close" data-dismiss="modal">&times;</a>
    <h4><i class="icon-tag"></i> Actualizar Campaña </h4>
</div>
<div class="modal-body">

    <?php echo $form->textFieldRow($model, 'nombre', array('maxlength' => 64)) ?>
    <?php echo $form->datepickerRow($model, 'fecha_inicio', array('options' => array('format' => 'dd/mm/yyyy', 'autoclose' => 'true', 'startDate' => 'today'))); ?>
    <?php echo $form->datepickerRow($model, 'fecha_fin', array('options' => array('format' => 'dd/mm/yyyy', 'autoclose' => 'true', 'startDate' => 'today'))); ?>
    <?php echo $form->dropDownListRow($model, 'nosey_form_id', array('' => ' -- Seleccione -- ') + CHtml::listData(Form::model()->findAll(), 'id', 'name'), array('class' => 'span5 fix')) ?>

    <!--<div class="check-box-list">-->
        <!--<h4><i class=""></i> Acciones  </h4>-->
        <!--<div class="offset4" >-->
            <?php
//            echo $form->labelEx($model, 'accion');
            echo $form->checkBoxListRow($model, 'accion', Campanias_Constants::getConstants());
//            echo $form->error($model, 'accion');
//            <!--            echo $form->checkBoxList($model, 'accion', Campanias_Constants::getConstants());
//                        echo $form->error($model, 'accion');-->
            ?>
        <!--</div>-->
    <!--</div>-->  

</div>


<div class="modal-footer">
    <?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'type' => 'success',
        'icon' => 'ok',
        'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Save'),
        'htmlOptions' => array(
            'onClick' => 'js:actualizarCampanias("#campania-form")')
    ));
    ?>
    <?php
    $this->widget('bootstrap.widgets.TbButton', array(
        'icon' => 'remove',
        'label' => Yii::t('AweCrud.app', 'Cancel'),
        'htmlOptions' => array(
            'data-dismiss' => 'modal',)
    ));
    ?>
</div>

<?php $this->endWidget(); ?>
